Fix IP Port Mapping overwritten by new LBs in the same VPC#6301
Fix IP Port Mapping overwritten by new LBs in the same VPC#6301SkalaNetworks wants to merge 4 commits intokubeovn:masterfrom
Conversation
Signed-off-by: SkalaNetworks <contact@skala.network>
Signed-off-by: SkalaNetworks <contact@skala.network>
…ing correctly Signed-off-by: SkalaNetworks <contact@skala.network>
Summary of ChangesHello @SkalaNetworks, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug where OVN Load Balancer IP port mappings were being incorrectly overwritten or erased when multiple load balancers were managed within the same VPC, causing health checks to fail. The core of the solution involves introducing a robust garbage collection routine that actively prunes stale IP port mapping entries from OVN Load Balancers. This change also refines the IP port mapping update and deletion logic to prevent unintended data loss and improve the overall stability and reliability of load balancing operations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the issue of ip_port_mapping being overwritten when multiple load balancers are created in the same VPC. The approach of simplifying the update logic in LoadBalancerUpdateIPPortMapping to only perform inserts and introducing a dedicated garbage collector (gcOvnLb) to clean up stale entries is robust and sound. The refactoring of LoadBalancerDeleteIPPortMapping into LoadBalancerDeleteVipIPPortMapping and a new function for deleting by backend IP improves code clarity. The accompanying unit and E2E tests provide good coverage for the new functionality. I have one minor suggestion to improve the E2E test implementation.
|
I truly was under the impression that the GC ran periodically, but it actually only works for LSPs. My GC function runs only once when the controller is restarted. I still wrote tests, but obviously they don't work. I think we'll have to reasses that point |
Signed-off-by: SkalaNetworks <contact@skala.network>
|
The current GC could do what I need, I'll clos this and address it elsewhere |
Pull Request
What type of this PR
When adding a SwitchLBRule in a VPC, the ip_port_mapping is populated to help the healthchecks run. If that field is not generated correctly, the healthchecks will not run and the LB will not work.
In the following condition, the ip_port_mapping is wrong:
The logic to handle ip_port_mapping has been faulty for a while, I tried fixing it a couple month back but made the issue worse.
This handles the fix differently:
With this fix:
I still lack 2 things that I will add later in the GC: